<template>
  <CardModules title="预警统计">
    <div class="warning-content">
      <div class="warning-item" v-for="(item, index) in cardList" :key="index">
        <div class="item-icon" :style="`background-color: ${item.color}`">
          <img :src="`/images/icon/${item.icon}`" alt="" />
        </div>
        <div class="item-info">
          <div class="item-title">{{ item.name }}</div>
          <div class="item-number">{{ item.value }}{{ item.util }}</div>
        </div>
      </div>
    </div>
  </CardModules>
</template>
<script setup>
  import CardModules from '/@/components/cardModules/index.vue';
  import { ref } from 'vue';

  const cardList = ref([
    {
      name: '今年累计流量',
      icon: 'chuanbo.png',
      value: 2728,
      util: '条',
      color: '#6EB9FF',
    },
    {
      name: '今年累计报警',
      icon: 'jinggao.png',
      value: 452,
      util: '次',
      color: '#F7967C',
    },
    {
      name: '今年偏航预警',
      icon: 'pianhang.png',
      value: 52,
      util: '次',
      color: '#92D89D',
    },
    {
      name: '今年超速报警',
      icon: 'chaosu.png',
      value: 150,
      util: '次',
      color: '#E7B554',
    },
  ]);
</script>

<style lang="less" scoped>
  @import './index.less';
</style>
